<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/14 0014
 * Time: 下午 10:53
 */
include "config.php";
include  "status.php";
if($_SERVER["REQUEST_METHOD"]=="POST"){
    if(isset($_REQUEST["gid"]) && isset($_REQUEST["uid"])){
        $gid = $_REQUEST["gid"];
        $uid = $_REQUEST["uid"];
        $sql = "DELETE FROM cart WHERE g_id=? AND u_id=?";
        $stmt = $conn->prepare($sql);
        $stmt->bind_param("ii", $gid,$uid);
        $stmt->execute();
        $listArr = array();
        if($stmt->affected_rows >= 1){
            print_r(json_encode(status::$r_success));
        }else{
            print_r(json_encode(status::$r_error));
        }
    }
}else{
    print_r(json_encode(status::$r_0));
}
